//
//  WordViewCell.m
//  XiangMuB
//
//  Created by 999999999999 on 16/8/16.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "WordViewCell.h"
#import "WordModel.h"
#import <UIImageView+WebCache.h>
#import "NSDate+Extension.h"
@implementation WordViewCell

-(void)awakeFromNib {
    //cell的背景图片
    UIImageView *bgView = [[UIImageView alloc]init];
    bgView.image = [UIImage imageNamed:@"mainCellBackground"];
    self.backgroundView = bgView;
}
-(void)setFrame:(CGRect)frame {
    frame.origin.x = 10;
    frame.size.width -= 2*frame.origin.x;
    frame.size.height -= 6;
    frame.origin.y += 10;
    [super setFrame:frame];
}
-(void)setModel:(WordModel *)model {
    _model = model;
    //赋值
    [self.iconImage sd_setImageWithURL:[NSURL URLWithString:model.profile_image] completed:nil];
        self.name.text = model.name;
        self.create_at.text = model.passtime;
        self.text.text = model.text;
//    //设置按钮控件
//        [self setupButtonTitle:self.dingBtn count:model.ding placeHolder:@"顶"];
//    [self setupButtonTitle:self.caiBtn count:model.cai placeHolder:@"踩"];

#pragma mark ---设置发帖时间
}
    
//   #pragma mark ---设置底部按钮文字
//-(void)setupButtonTitle:(UIButton *)button count:(NSInteger)count placeHolder:(NSString *)placeholder{
//    NSString *title = nil;
//    if (count == 0) {
//        title =  placeholder;
//    }else  if (count > 10000) {
//        title = [NSString stringWithFormat:@"%.1f万",count/10000.0];
//    }else {
//        title = [NSString stringWithFormat:@"%zd",count];
//    }
//    [button setTitle:title forState:UIControlStateNormal];
//}
//
//- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
//    [super setSelected:selected animated:animated];
//
//    // Configure the view for the selected state
//}

@end
